package com.machine.filling.Test;

import java.util.UUID;

/**
 * Created by Administrator on 2018/2/16 0016.
 */
@Deprecated
public class TestCommon {
    /**
     * 是否是调试串口模式
     */
    public static final boolean isTest_SerialPort = false;
    /**
     * 是否是调试模式
     */
    public static final boolean isTest = false;
    /**
     * 调试模式下,创建数据库
     */
    public static final boolean createDB = false;
    /**
     * 调试模式下的,串口名称
     */
    public static final String testSerialPort = "ttyS0";


    /**
     * 是否保存命令帧到文件中  !!!!!!永远为true
     */
    public static final boolean isSaveCMD = true;



    /**
     * 设备编号
     */
    public static final String device_num = "9357bd1a9435c9b";
    /**
     * 设备id
     */
    public static final String device_id = "22";

    /**
     * 登录名
     */
    public static final String login_name = "caozuoyuan";

    /**
     * 登录密码
     */
    public static final String login_psw = "111111";

    /**
     * 油站编号
     */
    public static final String station_num = "888888";

    /**
     * 油站id
     */
    public static final String station_id = "21";

    /**
     * 油机id
     */
    public static final String machine_id = "11";
    /**
     * 油机编号
     */
    public static final String machine_num = "00001";



    /**
     * 油枪id!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     */
    public static final String gunId = "25";
    /**
     * 油枪名称
     */
    public static final String gunName = "0001";
    /**
     * 油枪编号
     */
    public static final String gunNum = "0001";


    /**
     * 油罐id
     */
    public static final String tankId = "1";
    /**
     * 油罐名称
     */
    public static final String tankName = "一号油罐";
    /**
     * 油罐编号
     */
    public static final String tankNum = "0001";



    /**
     * 油品id
     */
    public static final String typeId = "1";
    /**
     * 油品编号
     */
    public static final String typeNum = "95";
    /**
     * 油品名称
     */
    public static final String typeName = "95号汽油";
    /**
     * 油品多名称
     */
    public static final String typeShortName = "95#";

    /**
     * 油卡id
     */
    public static final String cardId = "7";

    /**
     * 测试阶段平板的设备编号
     */
    public static final String realDeviceNum = "9357bd1a9435c9b";

    /**
     * 测试token
     */
//    public static final String token = "eyJhbGciOiJIUzUxMiIsInppcCI6IkRFRiJ9.eNoUi0sOwiAURfdyx6ThSWiRHThxBU0MpS8RhbYRGmqMexen5_NB5hj5dZlhSSA5fw8LX_cECyklQSC40pym82C07JUAH1sDRmlFg_mDkHPLR9RauyO4debno_NrGtF2HwMv5VbeG8OeBPI-tZjw_QEAAP__._JCBo0p_KxwEH0jQIEVAmJqMCNlh9LO2ppxOyBjH9jA94TEDW8ZNCwh-CQi4C-iLimCLwMx5RJ993HprfeSQ8g";
    public static final String token = "eyJhbGciOiJIUzUxMiIsInppcCI6IkRFRiJ9.eNoUjEEOwiAUBe_y1qThYxuVG7jxCobSn_gN0EYg2BjvXtxOZuaLzCHw-7bAGlKIzj8l8b1GWGiCgrgCS5M5j9pcaVLgz9bBZTxpY-gPJOcut9aGl7h9rbPzafBr7LEPwqk8yr5x_yvkOneVCL8DAAD__w.9AsSlQmasiCWT7KxkQd9FPWoo00bC-jFEH0M2yTWsP69aS_biAevwx5a1bcsbfJ-iOPKytqqyrO_uNwYZqLx0w";
    /**
     * 测试卡号
     */
    public static final String cardNum = "100000034";

    /**
     * 测试加密卡号
     */
    public static final String eneryCardNum = "EPuLE71rLI0vkY1FelAqjw==";

    /**
     * 测试预约订单编号
     */
    public static final String preOrderNum = "333333";
    /**
     * 订单编号
     */
    public static final String orderNum = "222222";
    /**
     * 串口号
     */
    public static final String serialNum = "ttyS0";


    /**
     * 促销单价
     */
    public static final String cuPrice = "6.80";
    /**
     * 价格油价
     */
    public static final String price = "7.80";

    /**
     * 串口返回 油机空闲
     */
    public static String TEST_SERIAL_DATA_FREE = "7EFE100121040B000000317B0000074402A98F120D";

    /**
     * 发送下发卡信息1101
     */
    public static String TEST_SERIAL_DATA_1101 = "7efe100111011f30313230303030303030302E3035000000000000000000003000000000000055240d";
    /**
     * 接收到8101加油前的准备
     */
    public static String TEST_SERIAL_DATA_8101 = "7efe1001810135101001123456188000000318800000030200000025920586283230202020202020202020200000000000000000000000000000000038ad0d";
    /**
     * 授权油卡
     */
    public static String TEST_SERIAL_DATA_AGREE = "7efe100121040b020003226c00003e720505589d0d";
    /**
     * 加油中
     */
    public static String TEST_SERIAL_DATA_FUELING = "7efe100121040b0f000004da000000610505de150d";
    /**
     * 加油结束
     */
    public static String TEST_SERIAL_DATA_END = "7efe100121013d30311880000003188000000330303030352e32393030303036372e373100001a8e03b30500000ffcf30084f23c20180401172734aa0220101001123456347c0d";



    public static String TEST_SERIAL_DATA = TEST_SERIAL_DATA_FREE;
    /**
     * 生成订单编号
     * @return
     */
    public static String createOrderNum(){
        int hashCodeV = UUID.randomUUID().toString().hashCode();
        if(hashCodeV < 0) {//有可能是负数
            hashCodeV = - hashCodeV;
        }
        // 0 代表前面补充0
        // 10 代表长度为10
        // d 代表参数为正数型
        String endStr = String.format("%010d", hashCodeV);
        String startStr = String.valueOf((int)((Math.random()*9+1)*10000));
        return   startStr+endStr;
    }

    /**
     * 油机里面的卡号
     */
    public static final String CARD_NUM = "18800000011880000001";
    /**
     * 油机里面的 加密卡号
     */
    public static final String CARD_NUM_ENCRYPT = "0000002591767652";

    /**
     * 调试小屏幕界面
     */
    public static final boolean isTestSmall = false;
    /**
     * 是否显示首页的油枪状态toast
     */
    public static final boolean isShowMainToast = false;

    //

}
